<?php
    @include_once("conn.php");
    @include_once("common.php");
    $phone=$_POST["phone"];
    // $pwd=$_POST["pwd"];
    if(!($phone)){
        argErr();
    }
    $search="select * from `regi` where phone='$phone'";
    $result=mysqli_query($conn,$search);
    $item=mysqli_fetch_assoc($result);
    $obj = array();
    if($item){   
      
        $realuser = $item["user"];
        $realphone=$item["phone"]; 

        if($realuser){
            $obj["status"] = true;
            $obj["detail"] = "登陆成功";
            $obj["list"]=$realuser;
            $obj["phone"]=$realphone;
        }else{
            $obj["status"] = false;
            $obj["detail"] = "手机号有误";
        }

    }else{ 
        $obj["status"] = false;
        $obj["detail"] = "该用户未注册";
    }

    echo json_encode($obj);
?>